Fix ESLint v10 RuleContext API removal (follow-up to #3972)#3979
Fix ESLint v10 RuleContext API removal (follow-up to #3972)#3979ledsun wants to merge 19 commits intojsx-eslint:masterfrom
Conversation
ljharb
left a comment
There was a problem hiding this comment.
we'll need regression tests - it might be as simple as adding eslint 10 to the GHA matrix.
f987ffa to
a7b967b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3979 +/- ##
==========================================
- Coverage 97.85% 97.68% -0.17%
==========================================
Files 136 136
Lines 10008 10014 +6
Branches 3717 3718 +1
==========================================
- Hits 9793 9782 -11
- Misses 215 232 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Run published type checks against both ESLint 7 and 10. Use per-matrix dependency setup and exclude unsupported TS combinations for ESLint 10.
- route filename/sourceCode access through util helpers for ESLint 7/10 compatibility - remove deprecated meta.docs.category to satisfy current RuleModule typings - augment @eslint/core SettingsConfig with react settings shape
Co-authored-by: Dom Armstrong <dom@dom-armstrong.co.uk>
| matrix: | ||
| node-version: ${{ fromJson(needs.matrix.outputs.latest) }} | ||
| eslint: | ||
| - 10 |
There was a problem hiding this comment.
you'll also need to exclude eslint 10 on node < 20
There was a problem hiding this comment.
To keep the total number of matrices under 256, I also excluded the combination of ESLint 10 and babel-eslint 8. If you know of a better combination, please let me know.
lib/util/version.js
Outdated
| const resolve = require('resolve'); | ||
| const semver = require('semver'); | ||
| const error = require('./error'); | ||
| const eslintUtil = require('./eslint'); |
There was a problem hiding this comment.
| const eslintUtil = require('./eslint'); | |
| const getFilename = require('./eslint').getFilename; |
package.json
Outdated
| "@typescript-eslint/parser": "^2.34.0 || ^3.10.1 || ^4 || ^5 || ^6.20 || ^7.14.1 || 8.4 - 8.17", | ||
| "babel-eslint": "^8 || ^9 || ^10.1.0", | ||
| "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7", | ||
| "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7 || ^10.0", |
There was a problem hiding this comment.
this might be premature; it's fine if the eslint 10 tests don't completely pass after this PR, and this line is what actually adds support for it.
however obv if this PR is sufficient to support eslint 10, this is great :-)
There was a problem hiding this comment.
I made the correction. I mistakenly thought it was necessary to run the combination of GitHub Actions.
This PR follows up on the feedback in the comments of #3972 and incorporates the requested changes.
I think this PR will fix #3977.